<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments :: head(~{::title})}">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>博客详情</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
  <link rel="stylesheet" href="/css/me.css">
  <link rel="stylesheet" href="/css/typo.css">
  <link rel="stylesheet" href="/css/animate.css">
  <link rel="stylesheet" href="/lib/prism/prism.css">
  <link rel="stylesheet" href="/lib/tocbot/tocbot.css">
  <link rel="stylesheet" href="/css/jquery.emoji.css">
</head>
<body>

  <!--导航-->
  <nav th:replace="fragments :: menu(0)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
    <div class="ui container">
      <div class="ui inverted secondary stackable menu">
        <h2 class="ui teal header item">Blog</h2>
        <a href="#" class="active m-item item m-mobile-hide"><i class="mini home icon"></i>首页</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="mini idea icon"></i>分类</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="mini tags icon"></i>标签</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="mini clone icon"></i>归档</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="mini info icon"></i>关于我</a>
        <div class="right m-item item m-mobile-hide">
          <div class="ui icon inverted transparent input m-margin-tb-tiny">
            <input type="text" placeholder="Search....">
            <i class="search link icon"></i>
          </div>
        </div>
      </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
      <i class="sidebar icon"></i>
    </a>
  </nav>

  <link rel="stylesheet" th:href="@{/css/alert_window.css}"/>

  <!--自定义弹窗-->
  <div class="widget widget1" id="window1" hidden="hidden">
    <div class="body">
      <div class="msg" style="color: red;font-size: 20px">提示</div>
      <div style="height:20px"> </div>
      <div class="msg"><b>评论信息不能为空哟!</b></div>
      <div class="btns">
        <a href="javascript:void(0);" class="btn-confirm" id="btn_ok1">确 定</a>
      </div>
    </div>
  </div>

  <!--中间内容-->
  <div id="waypoint" class="m-container m-padded-tb-big animated fadeIn">
    <div class="ui container">
      <div class="ui top attached segment">
        <div class="ui horizontal link list">
          <div class="item">
            <img src="https://unsplash.it/100/100?image=1005" th:src="@{${blog.user.avatar}}" alt="" class="ui avatar image">
            <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}">小朱</a></div>
          </div>
          <div class="item">
            <i class="calendar icon"></i>
            <span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2017-10-01</span>
            <span th:text="${#dates.format(blog.updateTime,'HH:mm:ss')}">16:00:00</span>
          </div>
          <div class="item">
            <i class="eye icon"></i>
            <span th:text="${blog.views}">2342</span>
          </div>
        </div>
      </div>
      <div class="ui attached segment">
        <!--图片区域-->
        <img src="https://unsplash.it/800/450?image=1005" th:src="@{${blog.firstPicture}}" alt="" class="ui fluid rounded image">
      </div>
      <div class="ui  attached padded segment">
        <!--内容-->
        <div class="ui right aligned basic segment">
          <div class="ui orange basic label" th:text="${blog.flag}">原创</div>
        </div>

        <h2 class="ui center aligned header" th:text="${blog.title}">关于刻意练习的清单</h2>
        <br>

        <!--  中间主要内容-->
        <div id="content" class="typo  typo-selection js-toc-content m-padded-lr-responsive m-padded-tb-large" th:utext="${blog.content}">
        </div>

        <!--标签-->
          <div class="m-padded-lr-responsive">
            <div class="ui teal basic left pointing label"
               th:each="tag : ${blog.tags}" th:text="${tag.name}">方法论</div>
          </div>

        <!--赞赏-->
        <div th:if="${blog.appreciation}">
          <div class="ui center aligned basic segment">
            <button id="payButton" class="ui orange basic circular button">赞赏</button>
          </div>
          <div class="ui payQR flowing popup transition hidden">
            <div class="ui orange basic label">
              <div class="ui images" style="font-size: inherit !important;">
                <div class="image">
                  <img th:src="@{/images/Alipay.jpg}" alt="" class="ui rounded bordered image" style="width: 120px">
                  <div>支付宝</div>
                </div>
                <div class="image">
                  <img th:src="@{/images/WeChatPay.jpg}" alt="" class="ui rounded bordered image" style="width: 120px">
                  <div>微信</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--博客信息-->
      <div class="ui attached positive message" th:if="${blog.shareStatement}">
        <div class="ui middle aligned grid">
          <div class="eleven wide column">
            <ui class="list">
              <li>作者：<span th:text="${blog.user.nickname}">朱志辉</span><a th:href="@{/about}" target="_blank">（About me）</a></li>
              <li>发表时间：<span th:text="${#dates.format(blog.createTime,'yyyy-MM-dd HH:mm')}">2017-10-02 09:08</span></li>
              <li>版权声明：自由转载-非商用-非衍生-保持署名</li>
              <li>公众号转载：请在文末添加作者博客地址</li>
            </ui>
          </div>
          <div class="five wide column">
            <img th:src="@{/images/wechart.jpg}" alt="" class="ui right floated rounded bordered image" style="width: 110px">
          </div>
        </div>
      </div>
      <!--留言区域列表-->
      <div class="ui bottom attached segment" th:if="${blog.commentabled}">
        <div id="comment-container" class="ui teal segment">
          <div th:fragment="commentList">
            <div class="ui threaded comments" style="max-width: 100%;">
              <h3 class="ui dividing header">评论</h3>
              <div class="comment" th:each="comment : ${comments}">
                <a class="avatar">
                  <img src="https://unsplash.it/100/100?image=1005" th:src="${comment.avatar}">
                </a>
                <div class="content">
                  <a class="author">
                    <span  style="color: #0ac7da">小朱</span>
                    <div class="ui mini basic adminComment left pointing label m-padded-mini" th:if="${comment.adminComment}==2">博主</div>
                    <div class="ui mini basic visitComment left pointing label m-padded-mini" th:if="${comment.adminComment}==1">贵宾</div>
                    <div class="ui mini basic touristComment left pointing label m-padded-mini" th:if="${comment.adminComment}==0">游客</div>
                  </a>
                  <div class="metadata">
                    <span class="date" th:text="${#dates.format(comment.createTime,'yyyy-MM-dd HH:mm')}">Today at 5:42PM</span>
                  </div>
                  <div id="commentText" class="text" th:utext="${comment.content}">
                    How artistic!
                  </div>
                  <div class="actions">
                    <a class="reply" data-commentid="1" data-commentnickname="Matt" th:attr="data-commentid=${comment.id},data-commentnickname=${comment.nickname}" onclick="reply(this)">回复</a>
                  </div>
                </div>

              <!--子评论-->
              <div class="comments" th:if="${#arrays.length(comment.replyComments)} >0">
                <div class="comment" th:each="reply : ${comment.replyComments}">
                  <a class="avatar">
                    <img src="https://unsplash.it/100/100?image=1005" th:src="${reply.avatar}">
                  </a>
                  <div class="content">
                    <a class="author">
                      <span th:text="${reply.nickname}" style="color: #eeaaaa">Matt</span>
                      <div class="ui mini basic adminComment left pointing label m-padded-mini" th:if="${reply.adminComment}==2">博主</div>
                      <span class="ui mini basic visitComment left pointing label m-padded-mini" th:if="${reply.adminComment}==1">贵宾</span>
                      <span class="ui mini basic touristComment left pointing label m-padded-mini" th:if="${reply.adminComment}==0">游客</span>
                      &nbsp;<span th:text="|@ ${reply.parentNickname}|" style="color: #0ac7da">@小红</span>
                    </a>
                    <div class="metadata">
                      <span class="date" th:text="${#dates.format(reply.createTime,'yyyy-MM-dd HH:mm')}">Today at 5:42PM</span>
                    </div>
                    <div id="replyCommentText" class="text" th:utext="${reply.content}">
                      How artistic!
                    </div>
                    <div class="actions">
                      <a class="reply" data-commentid="1" data-commentnickname="Matt" th:attr="data-commentid=${reply.id},data-commentnickname=${reply.nickname}" onclick="reply(this)">回复</a>
                    </div>
                  </div>
                </div>
              </div>
            </div>

            </div>
          </div>
        </div>
        <!-- 评论的表单-->
        <div id="comment-form" class="ui form">
          <input type="hidden" name="blogId" th:value="${blog.id}">
          <input type="hidden" name="parentComment.id" value="-1">
<!--          <div class="field">-->
<!--            <textarea name="content" placeholder="请输入评论信息..."></textarea>-->
<!--          </div>-->

          <div  id="commentEditor" class="fields" contenteditable="true" data-placeholder="请输入评论信息..."></div>

          <div class="fields">
        <!-- 表情按钮    -->
            <div class="field  m-margin-bottom-small m-mobile-wide" data-tooltip="点击表情没反应，稍微等一等或者刷新页面试试哟">
              <button id="emojiBtn" type="button" class="ui yellow button m-mobile-wide"><i class="large smile outline icon"></i>表情</button>
            </div>

            <div class="field m-mobile-wide m-margin-bottom-small">
              <div class="ui left icon input">
                <i class="user icon"></i>      <!--th:value="${session.nickname} != null ? ${session.nickname} :''-->
                <input type="text" name="nickname" placeholder="姓名" th:value="${session.nickname}!=null ? ${session.nickname}">
              </div>
            </div>
            <div class="field m-mobile-wide m-margin-bottom-small">
              <div class="ui left icon input">
                <i class="mail icon"></i>
                <input type="text" name="email" placeholder="邮箱" th:value="${session.user}!=null ? ${session.user.email}">
              </div>
            </div>
            <div class="field  m-margin-bottom-small m-mobile-wide">
              <button id="commentpost-btn" type="button" class="ui teal button m-mobile-wide"><i class="edit icon"></i>发送</button>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>

  <div id="toolbar" class="m-padded m-fixed m-right-bottom" style="display: none">
    <div class="ui vertical icon buttons ">
      <button type="button" class="ui toc teal button" >目录</button>
      <a href="#comment-container" class="ui teal button" >留言</a>
      <button type="button" class="ui share teal button" >分享</button>
      <button class="ui wechat icon button"><i class="weixin icon"></i></button>
      <div id="toTop-button" class="ui icon button" ><i class="chevron up icon"></i></div>
    </div>
  </div>

  <div class="ui toc-container flowing popup transition hidden" style="width: 250px!important;">
    <ol class="js-toc">

    </ol>
  </div>

  <!--点击分享弹出框-->
  <div class="ui share-container flowing popup transition hidden" style="width: 240px!important;">
    <div class="ui bottom attached segment">
      <button title="点击分享微博" onclick="sinaWeiBo()" class="ui weibo circular icon button" ><i class="red weibo icon"></i></button>
      <button title="点击分享微信" onclick="shareWeiXin()" class="ui wechat circular icon button" ><i class="green weixin icon"></i></button>
      <button title="点击分享QQ好友" onclick="shareQQ()" class="ui qq circular icon button"><i class="blue qq icon"></i></button>

      <button title="点击分享QQ空间" onclick="shareQQZone()" class="ui qqZone circular icon button"><i class="yellow share icon"></i></button>
    </div>
  </div>

  <!--微信分享图片-->
  <div id="qrcode" class="ui wechat-qr flowing popup transition hidden "style="width: 130px !important;">
    <img src="/images/wechart.jpg" alt="" class="ui rounded image" style="width: 120px !important;">
  </div>



  <br>
  <br>
  <!--底部footer-->
  <footer th:replace="fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">
      <div class="ui inverted divided stackable grid">
        <div class="three wide column">
          <div class="ui inverted link list">
            <div class="item">
              <img src="../static/images/wechart.jpg" class="ui rounded image" alt="" style="width: 110px">
            </div>
          </div>
        </div>
        <div class="three wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced " >最新博客</h4>
          <div class="ui inverted link list">
            <a href="#" class="item m-text-thin">用户故事（User Story）</a>
            <a href="#" class="item m-text-thin">用户故事（User Story）</a>
            <a href="#" class="item m-text-thin">用户故事（User Story）</a>
          </div>
        </div>
        <div class="three wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
          <div class="ui inverted link list">
            <a href="#" class="item m-text-thin">Email：lirenmi@163.com</a>
            <a href="#" class="item m-text-thin">QQ：865729312</a>
          </div>
        </div>
        <div class="seven wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced ">Blog</h4>
          <p class="m-text-thin m-text-spaced m-opacity-mini">这是我的个人博客、会分享关于编程、写作、思考相关的任何内容，希望可以给来到这儿的人有所帮助...</p>
        </div>
      </div>
      <div class="ui inverted section divider"></div>
      <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2016 - 2017 Lirenmi Designed by Lirenmi</p>
    </div>

  </footer>


  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
  <script th:src="@{/lib/prism/prism.js}"></script>
  <script th:src="@{/lib/tocbot/tocbot.min.js}"></script>
  <script th:src="@{/lib/qrcode/qrcode.min.js}"></script>
  <script th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>

  <script>
    $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");
  </script>

  <script>
    $('.ui.dropdown').dropdown({
      on: 'hover'
    });
  </script>

  <script src="/js/jquery.emoji.js"></script>
  <script src="/js/emoji.list.js"></script>
  <script src="http://connect.qq.com/widget/loader/loader.js" widget="shareqq" charset="utf-8"></script>

  <!--适配移动端和电脑端-->
  <script type="text/javascript">
    var browser = {
      versions: function () {
        var u = navigator.userAgent, app = navigator.appVersion;
        return {     //移动终端浏览器版本信息
          trident: u.indexOf('Trident') > -1, //IE内核
          presto: u.indexOf('Presto') > -1, //opera内核
          webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
          gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
          mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
          ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
          android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
          iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
          iPad: u.indexOf('iPad') > -1, //是否iPad
          webApp: u.indexOf('Safari') == -1 //是否web应用程序，没有头部与底部
        };
      }(),
      language: (navigator.browserLanguage || navigator.language).toLowerCase()
    }
    if (browser.versions.mobile) {

    }else if(!browser.versions.mobile){ //非移动端，动态加载js和div
      //blog页面不显示网易云音乐插件，因为右下角有菜单栏
      /*      onload = function () {
              var MusicDivShow = document.getElementById('netEasy-music');//获取指定div中的元素
              MusicDivShow.style.display = 'block';//控制层显示
            };*/
      <!-- 天气预报 -->
      WIDGET = {FID: 'EtgqPWMbdv'}
      var script4 = document.createElement('script');
      script4.type = 'text/javascript';
      script4.src = 'https://apip.weatherdt.com/float/static/js/r.js?v=1111';

      //鼠标点击出现的文字
      var script2 = document.createElement('script');
      script2.type = 'text/javascript';
      script2.src = '\\js\\click_show_text.js';

      //背景的几何条
      var script3 = document.createElement('script');
      script3.type = 'text/javascript';
      script3.color = '220,220,220';
      script3.opacity = '1.2';
      script3.zIndex = '-2';
      script3.count = '260';
      script3.src = '//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js';


      $('body').append(script4);
      $('body').append(script2);
      $('body').append(script3);
    }
  </script>




<script>
  var OriginTitile=document.title,st;
  document.addEventListener("visibilitychange",function(){
    document.hidden?(document.title="亲, 您别走呀！", clearTimeout(st)):(document.title="亲，您来啦！",st=setTimeout(function(){document.title=OriginTitile},3e3))
  })

</script>



  <script th:inline="javascript">

    /*加载emoji表情*/
    onload = function () {
      $("#commentEditor").emoji({
        button: "#emojiBtn",  //评论表情
        showTab: false,
        animation: 'slide',
        basePath: '/images/emoji',
        icons: emojiLists
      });

      $("#commentText").emojiParse({
        basePath: '/images/emoji',
        icons: emojiLists
      });
    };

    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    //点击赞赏弹出的框
    $('#payButton').popup({
      popup : $('.payQR.popup'),
      on : 'click',
      position: 'bottom center'
    });

    tocbot.init({
      // Where to render the table of contents.
      tocSelector: '.js-toc',
      // Where to grab the headings to build the table of contents.
      contentSelector: '.js-toc-content',
      // Which headings to grab inside of the contentSelector element.
      headingSelector: 'h1, h2, h3',
    });

    //右下角的目录
    $('.toc.button').popup({
      popup : $('.toc-container.popup'),
      on : 'click',
      position: 'left center'
    });

    //右下角的微信名片
    $('.wechat').popup({
      popup : $('.wechat-qr'),
      position: 'left center'
    });

    /*右下角的分享*/
    $('.share.button').popup({
      popup : $('.share-container.popup'),
      on : 'click',
      position: 'left center'
    });


    //滚回到顶部
    $('#toTop-button').click(function () {
      $(window).scrollTo(0,500);
    });

    //目录的滚动条的动态展示
    var waypoint = new Waypoint({
      element: document.getElementById('waypoint'),
      handler: function(direction) {
        if (direction == 'down') {
          $('#toolbar').show(100);
        } else {
          $('#toolbar').hide(500);
        }
        console.log('Scrolled to waypoint!  ' + direction);
      }
    });

    //评论表单验证
    $('.ui.form').form({
      fields: {
        title: {
          identifier: 'content',
          rules: [{
            type: 'empty',
            prompt: '请输入评论内容'
          }
          ]
        },
        content: {
          identifier: 'nickname',
          rules: [{
            type: 'empty',
            prompt: '请输入你的大名'
          }]
        },
        type: {
          identifier: 'email',
          rules: [{
            type: 'email',
            prompt: '请填写正确的邮箱地址'
          }]
        }
      }
    });

    //页面加载完成就显示评论列表，并不是要点击发送按钮才刷新显示出来
    $(function () {
      $("#comment-container").load(/*[[@{/comments/{id}(id=${blog.id})}]]*/"comments/1");
    });

    //发布按钮请求
    $('#commentpost-btn').click(function () {
      var boo = $('.ui.form').form('validate form');
      if (boo) {
        console.log('校验成功');
        postData();
      } else {
        console.log('校验失败');
        //弹出提示留言信息不能为空
        $('#window1').removeAttr('hidden');
        return;
      }
    });

    $(function () {
      //弹框的确认
      $('#btn_ok1').click(function () {
        $('#window1').attr('hidden','hidden');
      });
    });

    //提交评论的方法
    function postData() {
      $("#comment-container").load(/*[[@{/comments}]]*/"",{
        "parentComment.id" : $("[name='parentComment.id']").val(),
        "blogId" : $("[name='blogId']").val(),
        "nickname": $("[name='nickname']").val(),
        "email"   : $("[name='email']").val(),
        // "content" : $("[name='content']").val()
        "content" : document.getElementById("commentEditor").innerHTML
      },function (responseTxt, statusTxt, xhr) {
       $(window).scrollTo($('#comment-container'),500);
        clearContent();
      });
    }

    //发布完评论之后，重置评论框的内容
    function clearContent() {
      // $("[name='content']").val('');
      $("[name='parentComment.id']").val(-1);
      // $("[name='content']").attr("placeholder", "请输入评论内容...");
      document.getElementById("commentEditor").innerText='';
      $("[id='commentEditor']").attr("data-placeholder", "请输入评论信息...");
    }

    //回复评论方法
    function reply(obj) {
      var commentId = $(obj).data('commentid');
      var commentNickname = $(obj).data('commentnickname');
      // $("[name='content']").attr("placeholder", "@"+commentNickname).focus();
      $("[id='commentEditor']").attr("data-placeholder", "@"+commentNickname);
      $("[name='parentComment.id']").val(commentId);
      $(window).scrollTo($('#comment-form'),400);
    }

    /*QQ分享*/
    function shareQQ() {
      var param = {
        url: encodeURIComponent(window.location.href),
        desc: '博客写的不错哟，值得看一看!',
        title : localStorage.getItem("blogTitle"),
        summary : '我分享了一篇博客，快来看看呀！',
        pics : localStorage.getItem("blogFirstPicture"),
        //flash : '',
        sharesource:'qq',
        site: 'Brandt_blog'
      };
      var s = [];
      for (var i in param) {
        s.push(i + '=' + encodeURIComponent(param[i] || ''));
      }
      var targetUrl = "https://connect.qq.com/widget/shareqq/iframe_index.html?" + s.join('&') ;
      //var targetUrl = "http://connect.qq.com/widget/shareqq/index.html?" + s.join('&') ;
      //window.location.href=targetUrl;
      window.open(targetUrl, 'qq', 'height=600, width=600');
    }

    /*分享QQ空间*/
    function shareQQZone() {
      var param = {
        url: window.location.href,
        sharesource: 'qzone',
        title : localStorage.getItem("blogTitle"),
        summary : '我分享了一篇博客，快来看看呀！',
        pics : localStorage.getItem("blogFirstPicture"),
      };
      var s = [];
      for (var i in param) {
        s.push(i + '=' + encodeURIComponent(param[i] || ''));
      }
      var targetUrl = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?" + s.join('&') ;
      //window.location.href=targetUrl;
      window.open(targetUrl, 'qqZone', 'height=600, width=600');
    }

    //微信分享
    function shareWeiXin() {
      var url = window.location.href,
              encodePath = encodeURIComponent(url),
              targetUrl = 'http://qr.liantu.com/api.php?text=' + encodePath;
      window.open(targetUrl, 'weixin', 'height=400, width=400');
    }

    /**
     * 分享新浪微博
     * @param  {[type]} title [分享标题]
     * @param  {[type]} url   [分享url链接，默认当前页面]
     * @param  {[type]} pic   [分享图片]
     * @return {[type]}       [description]
     */
    function sinaWeiBo() {
      var param = {
        url: window.location.href,
        type: '3',
        count: '', /** 是否显示分享数，1显示(可选)*/
        appkey: '', /** 您申请的应用appkey,显示分享来源(可选)*/
        title: localStorage.getItem("blogTitle"), /** 分享的文字内容(可选，默认为所在页面的title)*/
        pic: localStorage.getItem("blogFirstPicture"), /**分享图片的路径(可选)*/
        ralateUid:'', /**关联用户的UID，分享微博会@该用户(可选)*/
        rnd: new Date().valueOf()
      }
      var temp = [];
      for( var p in param ) {
        temp.push(p + '=' +encodeURIComponent( param[p ] || '' ) )
      }
      var targetUrl = 'http://service.weibo.com/share/share.php?' + temp.join('&');
      //window.open(targetUrl, 'sinaweibo', 'height=430, width=400');
      window.location.href=targetUrl;
    }

  </script>
</body>
</html>